package controller.user.setmeal;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import model.VO.C_SetmealVO;
import service.Impl.C_IdServiceImpl;
import util.ResultUtil;

import java.io.IOException;
import java.util.List;

@WebServlet("/user/setmeal/list")
public class SetmealByIdCon extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        C_IdServiceImpl service=new C_IdServiceImpl();
        List<C_SetmealVO> vos=service.Find(Integer.parseInt(req.getParameter("categoryId")));
        String json= ResultUtil.getJSON(vos);
        resp.getWriter().write(json);
    }
}
